package sunwin.yoms.service.comm;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sunwin.yoms.domain.person.UserLevelDomain;
import sunwin.yoms.domain.person.UserStateDomain;
import sunwin.yoms.domain.publicty.NewsTypeDomain;
import sunwin.yoms.domain.publicty.VerifyStateDomain;
import sunwin.yoms.domain.publicty.VideoTypeDomain;
import sunwin.yoms.domain.resource.StadiumDomain;
import sunwin.yoms.domain.resource.StadiumGroupDomain;
import sunwin.yoms.domain.resource.StadiumStateDomain;
import sunwin.yoms.service.person.UserLeveService;
import sunwin.yoms.service.person.UserStateService;
import sunwin.yoms.service.publicty.NewsTypeService;
import sunwin.yoms.service.publicty.VerifyStateService;
import sunwin.yoms.service.publicty.VideoTypeService;
import sunwin.yoms.service.resource.StadiumGroupService;
import sunwin.yoms.service.resource.StadiumService;
import sunwin.yoms.service.resource.StadiumStateService;

import java.util.List;

/**
 * Created by 田西泽 on 2015-8-4.
 */
@Service
public class YomsDefaultData {
    /**
     * 超级管理登录名
     */
    public static String AdminLoginName = "yoms.admin";
    public static String WebRoot =  System.getProperty("webroot");
    public static int VerifyStateId = 2;
	public static int AdminLevelId = 2;

    @Autowired
    private UserLeveService userLeveService;
    @Autowired
    private UserStateService userStateService;
    @Autowired
    private NewsTypeService newsTypeService;
    @Autowired
    private VerifyStateService verifyStateService;
    @Autowired
    private VideoTypeService videoTypeService;
    @Autowired
    private StadiumGroupService stadiumGroupService;
    @Autowired
    private StadiumStateService stadiumStateService;
    @Autowired
    private StadiumService stadiumService;

    private List<UserLevelDomain> allUserLevel;
    private List<UserStateDomain> allUserState;
    private List<NewsTypeDomain> allNewsType;
    private List<VerifyStateDomain> allVerifyState;
    private List<StadiumGroupDomain> allStadiumGroup;
    private List<StadiumStateDomain> allStadiumState;
    private List<VideoTypeDomain> allVideoType;
    private List<StadiumDomain> allStadium;

    /**
     * 获取场馆名字
     */
    public List<StadiumDomain> getAllStadium(){
        if (allStadium == null){
            allStadium=stadiumService.getStadiumDomain(null);
        }
        return allStadium;
    }

    /**
     * 获取视频类型
     *
     * @return
     */
    public List<VideoTypeDomain> getAllVideoType() {
        if (allVideoType == null) {
            allVideoType = videoTypeService.getVideoTypeDomain(null);
        }
        return allVideoType;
    }

    /**
     * 获取场馆状态
     */
    public List<StadiumStateDomain> getAllStadiumState() {
        if (allStadiumState == null) {
            allStadiumState = stadiumStateService.getStadiumState(null);
        }
        return allStadiumState;
    }

    /**
     * 获取场馆分组
     *
     * @return
     */
    public List<StadiumGroupDomain> getAllStadiumGroup() {
        if (allStadiumGroup == null) {
            allStadiumGroup = stadiumGroupService.getStadiumGroup(null);
        }
        return allStadiumGroup;
    }

    /**
     * 获取所有新闻类型
     */
    public List<NewsTypeDomain> getAllNewsType() {
        if (allNewsType == null) {
            allNewsType = newsTypeService.getNewsType(null);
        }
        return allNewsType;
    }

    /**
     * 获取审核状态
     */
    public List<VerifyStateDomain> getAllVerifyState() {
        if (allVerifyState == null) {
            allVerifyState = verifyStateService.getVerfiDomain(null);
        }
        return allVerifyState;
    }

    /**
     * 获取所有用户的级别
     *
     * @return
     */
    public List<UserLevelDomain> getAllUserLevel() {
        if (allUserLevel == null) {
            allUserLevel = userLeveService.getUserLeve(null);
        }
        return allUserLevel;
    }

    /**
     * 获取所有用户的状态
     *
     * @return
     */
    public List<UserStateDomain> getAllUserState() {
        if (allUserState == null) {
            allUserState = userStateService.getUserState(null);
        }
        return allUserState;
    }
}
